<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template param</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_typeerasure/reference.html#header.boost.type_erasure.param_hpp" title="Header &lt;boost/type_erasure/param.hpp&gt;">
<link rel="prev" href="as_param.html" title="Struct template as_param">
<link rel="next" href="_a.html" title="Struct _a">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="as_param.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_typeerasure/reference.html#header.boost.type_erasure.param_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="_a.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.type_erasure.param"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template param</span></h2>
<p>boost::type_erasure::param — A wrapper to help with overload resolution for functions operating on an <a class="link" href="any.html" title="Class template any">any</a>. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_typeerasure/reference.html#header.boost.type_erasure.param_hpp" title="Header &lt;boost/type_erasure/param.hpp&gt;">boost/type_erasure/param.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Concept<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="param.html" title="Class template param">param</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// <a class="link" href="param.html#boost.type_erasure.paramconstruct-copy-destruct">construct/copy/destruct</a></span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <a class="link" href="param.html#id-1_3_42_13_25_1_1_2_5-bb"><span class="identifier">param</span></a><span class="special">(</span><a class="link" href="../any.html" title="Class any">any</a><span class="special">&lt;</span> <span class="identifier">Concept</span><span class="special">,</span> <span class="identifier">U</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <a class="link" href="param.html#id-1_3_42_13_25_1_1_2_6-bb"><span class="identifier">param</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../any.html" title="Class any">any</a><span class="special">&lt;</span> <span class="identifier">Concept</span><span class="special">,</span> <span class="identifier">U</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <a class="link" href="param.html#id-1_3_42_13_25_1_1_2_7-bb"><span class="identifier">param</span></a><span class="special">(</span><a class="link" href="../any.html" title="Class any">any</a><span class="special">&lt;</span> <span class="identifier">Concept</span><span class="special">,</span> <span class="identifier">U</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="param.html#id-1_3_42_13_25_1_1_2_4-bb">public member functions</a></span>
  <a class="link" href="../any.html" title="Class any">any</a><span class="special">&lt;</span> <span class="identifier">Concept</span><span class="special">,</span> <span class="identifier">T</span> <span class="special">&gt;</span> <a class="link" href="param.html#id-1_3_42_13_25_1_1_2_4_1-bb"><span class="identifier">get</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.42.13.26.4.4"></a><h2>Description</h2>
<p>The template arguments are interpreted in the same way as <a class="link" href="any.html" title="Class template any">any</a>.</p>
<p>A parameter of type <a class="link" href="param.html" title="Class template param">param</a> can be initialized with an <a class="link" href="any.html" title="Class template any">any</a> that has the same <code class="computeroutput">Concept</code> and base placeholder when there exists a corresponding standard conversion for the placeholder. A conversion sequence from <a class="link" href="any.html" title="Class template any">any&lt;C, P&gt;</a> to <a class="link" href="param.html" title="Class template param">param&lt;C, P1&gt;</a> is a better conversion sequence than <a class="link" href="any.html" title="Class template any">any&lt;C, P&gt;</a> to <a class="link" href="param.html" title="Class template param">param&lt;C, P2&gt;</a> iff the corresponding placeholder standard conversion sequence from P to P1 is a better conversion sequence than P to P2.</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>Overloading based on cv-qualifiers and rvalue-ness is only supported in C++11. In C++03, all conversion sequences from <a class="link" href="any.html" title="Class template any">any</a> to <a class="link" href="param.html" title="Class template param">param</a> have the same rank.</p></td></tr>
</table></div>
<p>
Example:</p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">param</span><span class="special">&lt;</span><span class="identifier">C</span><span class="special">,</span> <span class="identifier">_a</span><span class="special">&amp;</span><span class="special">&gt;</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">param</span><span class="special">&lt;</span><span class="identifier">C</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">_a</span><span class="special">&amp;</span><span class="special">&gt;</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">void</span> <span class="identifier">g</span><span class="special">(</span><span class="identifier">param</span><span class="special">&lt;</span><span class="identifier">C</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">_a</span><span class="special">&amp;</span><span class="special">&gt;</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">void</span> <span class="identifier">g</span><span class="special">(</span><span class="identifier">param</span><span class="special">&lt;</span><span class="identifier">C</span><span class="special">,</span> <span class="identifier">_a</span><span class="special">&amp;&amp;</span><span class="special">&gt;</span><span class="special">)</span><span class="special">;</span>

<span class="identifier">any</span><span class="special">&lt;</span><span class="identifier">C</span><span class="special">,</span> <span class="identifier">_a</span><span class="special">&gt;</span> <span class="identifier">a</span><span class="special">;</span>
<span class="identifier">f</span><span class="special">(</span><span class="identifier">any</span><span class="special">&lt;</span><span class="identifier">C</span><span class="special">,</span> <span class="identifier">_a</span><span class="special">&gt;</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span> <span class="comment">// calls void f(param&lt;C, const _a&amp;&gt;);</span>
<span class="identifier">f</span><span class="special">(</span><span class="identifier">a</span><span class="special">)</span><span class="special">;</span>            <span class="comment">// calls void f(param&lt;C, _a&amp;&gt;); (ambiguous in C++03)</span>
<span class="identifier">g</span><span class="special">(</span><span class="identifier">any</span><span class="special">&lt;</span><span class="identifier">C</span><span class="special">,</span> <span class="identifier">_a</span><span class="special">&gt;</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span> <span class="comment">// calls void g(param&lt;C, _a&amp;&amp;&gt;); (ambiguous in C++03)</span>
<span class="identifier">g</span><span class="special">(</span><span class="identifier">a</span><span class="special">)</span><span class="special">;</span>            <span class="comment">// calls void g(param&lt;C, const _a&amp;&gt;);</span>
</pre>
<p> </p>
<div class="refsect2">
<a name="id-1.3.42.13.26.4.4.6"></a><h3>
<a name="boost.type_erasure.paramconstruct-copy-destruct"></a><code class="computeroutput">param</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <a name="id-1_3_42_13_25_1_1_2_5-bb"></a><span class="identifier">param</span><span class="special">(</span><a class="link" href="../any.html" title="Class any">any</a><span class="special">&lt;</span> <span class="identifier">Concept</span><span class="special">,</span> <span class="identifier">U</span> <span class="special">&gt;</span> <span class="special">&amp;</span> a<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <a name="id-1_3_42_13_25_1_1_2_6-bb"></a><span class="identifier">param</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="../any.html" title="Class any">any</a><span class="special">&lt;</span> <span class="identifier">Concept</span><span class="special">,</span> <span class="identifier">U</span> <span class="special">&gt;</span> <span class="special">&amp;</span> a<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <a name="id-1_3_42_13_25_1_1_2_7-bb"></a><span class="identifier">param</span><span class="special">(</span><a class="link" href="../any.html" title="Class any">any</a><span class="special">&lt;</span> <span class="identifier">Concept</span><span class="special">,</span> <span class="identifier">U</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span> a<span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.42.13.26.4.4.7"></a><h3>
<a name="id-1_3_42_13_25_1_1_2_4-bb"></a><code class="computeroutput">param</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><a class="link" href="../any.html" title="Class any">any</a><span class="special">&lt;</span> <span class="identifier">Concept</span><span class="special">,</span> <span class="identifier">T</span> <span class="special">&gt;</span> <a name="id-1_3_42_13_25_1_1_2_4_1-bb"></a><span class="identifier">get</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns the stored <code class="computeroutput"><a class="link" href="any.html" title="Class template any">any</a></code>. </p>
</li></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2011-2013 Steven Watanabe<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="as_param.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_typeerasure/reference.html#header.boost.type_erasure.param_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="_a.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
